function PlotTiming()


load('PeaksJoinedCWDJDSJF.mat');

subjects = unique(datatable(:,strcmp(header,'Subject')));
% channels(1) = {'FRO_A', 'FRO_P', 'IPS_I', 'IPS_S', 'OCC_D', 'OCC_V', 'PAR_A', 'PAR_O', 'TEM_I', 'TEM_M', 'TEM_S'};
channels{1} = {'IPSS', 'OCC', 'TEM'};
channels{2} = {'IPSI', 'IPSS', 'OCCD', 'OCCV', 'PARA', 'PARO'};
channels{3} = {'FROP', 'FROA', 'TEMI', 'TEMM', 'TEMS'};
channels{4} = {'m1OCCD', 'm1OCCV', 'm1TEM', 'm1IPSS', 'mMotor'};
frequencybins = {'7-13Hz', '70-130Hz'}; %,  '4-7Hz','13-30Hz', '30-70Hz',
% frequencybins = {'7-13Hz', '30-70Hz'};
% frequencybins = unique(datatable(:,strcmp(header,'Bin')));

for sI = 1:length(subjects) % 6x
    for cI = 1:length(channels) % 2x
        for fI = 1:length(frequencybins) % 5x
            
            prptCfg = plotRegionPeakTiming_defaultCfg();
            prptCfg.SubjectSelection = subjects{sI};
            prptCfg.BinSelection = frequencybins{fI};
            subplots = channels{cI};
            
            fig = figure;
            for s = 1:length(subplots)
                prptCfg.ChannelSelection = subplots{s};
                subplot(length(subplots),1,s);
                plotRegionPeakTiming(datatable, header, prptCfg);
                ylabel(subplots{s});
            end
            a = axes('position',[.02 .02 .96 .96],'Visible', 'off');
            text('Position', [0.01 0.99], 'String', [prptCfg.SubjectSelection ' / ' prptCfg.BinSelection], ...
                'HorizontalAlignment', 'left', 'VerticalAlignment', 'cap', 'Parent', a, 'Interpreter', 'none');
            text('Position', [0.5 0.01], 'String', datestr(now, 'yyyy-mm-dd HH:MM:SS'), ...
                'HorizontalAlignment', 'center', 'VerticalAlignment', 'baseline', 'Parent', a);
            
            saveFigure(fig, [getpref('ECoG','Results') 'Timing\'], ['Timing ' subjects{sI} ' ' frequencybins{fI} ' (' num2str(cI) ')']);
%             saveFigure(f, [getpref('ECoG','Results') 'Timing\'], ['Timing']);
            close(fig);
        end
    end
end


end